package net.googlecode.exigenlab.task3;

import java.math.BigDecimal;

/**
 * Created by IntelliJ IDEA.
 * User: dima
 * Date: 3/25/11
 * Time: 8:36 PM
 * To change this template use File | Settings | File Templates.
 */
public class SalaryApp {

    public static void main(String[] args) {
        SalaryApp app = new SalaryApp();

        SalaryCalculator cal = new SalaryCalculator();

        System.out.println("Manager #1: $" + cal.calc(createManagerWithoutBonus()));
        System.out.println("Manager #2: $" + cal.calc(createManagerWithBonus()));
        System.out.println("Employee #1: $" + cal.calc(createEmployeeWithBonus()));
        System.out.println("Employee #2: $" + cal.calc(createEmployeeWithoutBonus()));
    }

    public static Manager createManagerWithoutBonus() {
        Manager manager = new Manager("Ivan", "Ivanov");
        manager.age = 30;
        manager.perHour = true;
        manager.bonus = false;
        manager.rate = new BigDecimal(25);

        return manager;
    }

    public static Manager createManagerWithBonus() {
        Manager manager = new Manager("Petr", "Petrov");
        manager.age = 35;
        manager.bonus = true;
        manager.bonusAmt = new BigDecimal(1000);
        manager.perHour = false;
        manager.rate = new BigDecimal(5000);

        return manager;
    }

    public static Employee createEmployeeWithBonus() {
        Employee employee = new Employee("Semen", "Semenov");
        employee.age = 55;
        employee.bonus = true;
        employee.bonusAmT = new BigDecimal(1500);
        employee.perHour = true;
        employee.rate = new BigDecimal(8);

        return employee;
    }

    public static Employee createEmployeeWithoutBonus() {
        Employee employee = new Employee("Sergey", "Sergeev");
        employee.age = 45;
        employee.bonus = false;
        employee.perHour = false;
        employee.experience = 15;
        employee.rate = new BigDecimal(200);

        return employee;
    }
}
